package com.cuijq.ms.template.v5;

/**
 * @author by CuiJQ
 * @Classname ShutdownHookDemo
 * @Description ShutdownHookDemo Description
 * @Date 2021/5/28 20:47
 */
public class ShutdownHookDemo {

  private static class ShutdownHook extends Thread {

    @Override
    public void run() {
      System.out.println("I am called during shutting down.");
    }
  }

  public static void main(String[] args) {
    Runtime.getRuntime().addShutdownHook(new ShutdownHook());
  }
}
